import request from '@/utils/request'
// import { usearticlestore } from '@/stores/modules/article'
// let articlestore = usearticlestore()
// 发生请求获取文章分类模块的数据
export const articlechannelservice = () => {
  return request.get('/api/channel')
}
// 添加分类
export const articleaddchannelservice = (formdata) => {
  return request.put('/api/addchannel', formdata)
}
// 编辑分类
export const articleemitchannelservice = (formdata) => {
  return request.post('/api/emitchannel', formdata)
}
//删除分类
export const articledeletechannelservice = (id) => {
  console.log(id)
  return request.delete('/api/delchannel', {
    params: {
      id
    }
  })
}
// 获取文章内容
export const articlegetarticlelistservice = (params) => {
  return request.get('/api/manage', {
    params: params
  })
}
// 发布文章到服务器
export const articlepublishservice = (data, id) => {
  return request.post(`/api/publish?id=${id}`, data)
}
//删除文章
export const articledelservice = (id) => {
  return request.delete('/api/delarticle', {
    params: {
      id: id
    }
  })
}
